package com.rainmonth.nicehair.ui.fragment;

import butterknife.ButterKnife;
import butterknife.Bind;

import com.rainmonth.nicehair.R;
import com.rainmonth.nicehair.adapter.ZoneHotAdapter;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.GridView;

public class ZoneHotFragment extends Fragment {

    @Bind(R.id.grid_zone_hot_tag)
    GridView mGridView;
    private ZoneHotAdapter mAdapter;

    public static ZoneHotFragment newInstance() {
        ZoneHotFragment fragment = new ZoneHotFragment();
        Bundle bundle = new Bundle();
        fragment.setArguments(bundle);
        return fragment;
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        View contentView = inflater.inflate(R.layout.view_zone_hot_tag, container, false);
        ButterKnife.bind(this, contentView);
        mAdapter = new ZoneHotAdapter(getActivity());
        mGridView.setAdapter(mAdapter);
        mGridView.setOnItemClickListener(new OnItemClickListener() {

            @Override
            public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
                                    long arg3) {
                // TODO Auto-generated method stub

            }
        });
        return contentView;
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        ButterKnife.unbind(this);
    }
}
